<!doctype html>


<html>
<head>
  <link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon">
  <title>Aes (Closure Library API Documentation - JavaScript)</title>
  <link rel="stylesheet" href="static/css/base.css">
  <link rel="stylesheet" href="static/css/doc.css">
  <link rel="stylesheet" href="static/css/sidetree.css">
  <link rel="stylesheet" href="static/css/prettify.css">

  <script>
     var _staticFilePath = "static/";
     var _typeTreeName = "goog";
     var _fileTreeName = "Source";
  </script>

  <script src="static/js/doc.js">
  </script>

  <script type="text/javascript" src="//www.google.com/jsapi"></script>
  <script type="text/javascript">
     google.load("visualization", "1", {packages:["orgchart"]});
     var _loadingVisualizations = true;
  </script>

  <meta charset="utf8">
</head>

<body onload="grokdoc.onLoad();">

<div id="header">
  <div class="g-section g-tpl-50-50 g-split">
    <div class="g-unit g-first">
      <a id="logo" href="index.html">Closure Library API Documentation</a>
    </div>

    <div class="g-unit">
      <div class="g-c">
        <strong>Go to class or file:</strong>
        <input type="text" id="ac">
      </div>
    </div>
  </div>
</div>





<div class="colmask rightmenu">
<div class="colleft">
    <div class="col1">
      <!-- Column 1 start -->

<div id="title">
        <span class="fn">crypt.Aes</span>
        <span>Extends</span>
        <span class="fn-name">
          Object
        </span>
</div>

<div class="g-section g-tpl-75-25">
  <div class="g-unit g-first" id="description">
    Implementation of AES in JavaScript.
See <a href="http://en.wikipedia.org/wiki/Advanced_Encryption_Standard">http://en.wikipedia.org/wiki/Advanced_Encryption_Standard</a>

WARNING: This is ECB mode only. If you are encrypting something
longer than 16 bytes, or encrypting more than one value with the same key
(so basically, always) you need to use this with a block cipher mode of
operation.  See goog.crypt.Cbc.

See <a href="http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation">http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation</a> for more
information.
  </div>


        <div class="g-unit" id="useful-links">
          <div class="title">Useful links</div>
          <ol>
            <li><a href="closure_goog_crypt_aes.js.source.html"><span class='source-code-link'>Source Code</span></a></li>
            <li><a href="http://code.google.com/p/closure-library/source/browse/closure/goog/crypt/aes.js">Git</a></li>
          </ol>
        </div>
</div>






<h2 class="g-first">Inheritance</h2>
<div class='gviz-org-chart-container goog-inline-block'>
<table class='gviz-org-chart' style='display:none'>
  <tr><td>goog.crypt.Aes</td><td></td></tr>
</table>
</div>
<div class='gviz-org-chart-container goog-inline-block'>
<table class='gviz-org-chart' style='display:none'>
</table>
</div>




  <h2>Constructor</h2>
      <div class="fn-constructor">
    goog.crypt.Aes(<span><span class="arg">key</span></span>)
  </div>

   <h3>Parameters</h3>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">key</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;</div>
        <div class="entryOverview">The key as an array of integers in {0, 255}. The key must have lengths of 16, 24, or 32 integers for 128-, 192-, or 256-bit encryption, respectively.</div>
     </td>
   </tr>
  </table>


<h2>Instance Methods</h2>


  <div class="legend">
        <span class="key publickey"></span><span>Public</span>
        <span class="key protectedkey"></span><span>Protected</span>
        <span class="key privatekey"></span><span>Private</span>
  </div>







<div>
       <div class="desc">
         Defined in
         <span class="fn-name">
            <a href="class_goog_crypt_Aes.html">
              goog.crypt.Aes
            </a>
         </span>
       </div>






<div class="section">
  <table class="horiz-rule">


     <tr class="even entry private">
       <td class="access"></td>






  <td>
    <a name="goog.crypt.Aes.prototype.addRoundKey_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">addRoundKey_<span class="args">(<span class="arg">round</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       AES's AddRoundKey procedure. Add the current round key to the state.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">round</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
        <div class="entryOverview">The current round.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_crypt_aes.js.source.html#line344">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>






  <td>
    <a name="goog.crypt.Aes.prototype.copyInput_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">copyInput_<span class="args">(<span class="arg">input</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Helper to copy input into the AES state matrix.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">input</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;</div>
        <div class="entryOverview">Byte array to copy into the state matrix.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_crypt_aes.js.source.html#line302">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.crypt.Aes.prototype.decrypt"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">decrypt<span class="args">(<span class="arg">input</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">input</span>
        : 
        <div class="entryOverview"><span class='nodesc'>No description.</span></div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_crypt_aes.js.source.html#line150">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.crypt.Aes.prototype.encrypt"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">encrypt<span class="args">(<span class="arg">input</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">input</span>
        : 
        <div class="entryOverview"><span class='nodesc'>No description.</span></div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_crypt_aes.js.source.html#line98">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>






  <td>
    <a name="goog.crypt.Aes.prototype.generateOutput_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">generateOutput_<span class="args">()</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;</div>
      </div>


     <div class="entryOverview">
       Helper to copy the state matrix into an output array.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;</div>&nbsp;
            Output byte array.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_crypt_aes.js.source.html#line328">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>






  <td>
    <a name="goog.crypt.Aes.prototype.invMixColumns_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">invMixColumns_<span class="args">()</span>
        </span>
      </div>


     <div class="entryOverview">
       AES's InvMixColumns procedure.
     </div>

   
  </td>


  <td class="view-code">
     <a href="closure_goog_crypt_aes.js.source.html#line439">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>






  <td>
    <a name="goog.crypt.Aes.prototype.invShiftRows_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">invShiftRows_<span class="args">()</span>
        </span>
      </div>


     <div class="entryOverview">
       AES's InvShiftRows procedure. Shift the values in each row to the right.
     </div>

   
  </td>


  <td class="view-code">
     <a href="closure_goog_crypt_aes.js.source.html#line393">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>






  <td>
    <a name="goog.crypt.Aes.prototype.keyExpansion_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">keyExpansion_<span class="args">()</span>
        </span>
      </div>


     <div class="entryOverview">
       AES's KeyExpansion procedure. Create the key schedule from the initial key.
     </div>

   
  </td>


  <td class="view-code">
     <a href="closure_goog_crypt_aes.js.source.html#line472">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>






  <td>
    <a name="goog.crypt.Aes.prototype.mixColumns_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">mixColumns_<span class="args">()</span>
        </span>
      </div>


     <div class="entryOverview">
       AES's MixColumns procedure. Mix the columns of the state using magic.
     </div>

   
  </td>


  <td class="view-code">
     <a href="closure_goog_crypt_aes.js.source.html#line413">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>






  <td>
    <a name="goog.crypt.Aes.prototype.rotWord_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">rotWord_<span class="args">(<span class="arg">w</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;</div>
      </div>


     <div class="entryOverview">
       AES's RotWord procedure.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">w</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;</div>
        <div class="entryOverview">Array of bytes to rotate.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;</div>&nbsp;
            The rotated bytes.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_crypt_aes.js.source.html#line542">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>






  <td>
    <a name="goog.crypt.Aes.prototype.shiftRows_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">shiftRows_<span class="args">()</span>
        </span>
      </div>


     <div class="entryOverview">
       AES's ShiftRows procedure. Shift the values in each row to the right. Each
row is shifted one more slot than the one above it.
     </div>

   
  </td>


  <td class="view-code">
     <a href="closure_goog_crypt_aes.js.source.html#line373">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>






  <td>
    <a name="goog.crypt.Aes.prototype.subBytes_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">subBytes_<span class="args">(<span class="arg">box</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       AES's SubBytes procedure. Substitute bytes from the precomputed SBox lookup
into the state.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">box</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;</div>
        <div class="entryOverview">The SBox or invSBox.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_crypt_aes.js.source.html#line359">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>






  <td>
    <a name="goog.crypt.Aes.prototype.subWord_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">subWord_<span class="args">(<span class="arg">w</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;</div>
      </div>


     <div class="entryOverview">
       AES's SubWord procedure.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">w</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;</div>
        <div class="entryOverview">Bytes to find the SBox substitution for.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;</div>&nbsp;
            The substituted bytes.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_crypt_aes.js.source.html#line526">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>






  <td>
    <a name="goog.crypt.Aes.prototype.testAfterAddRoundKey_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">testAfterAddRoundKey_<span class="args">(<span class="arg">roundNum</span>,&nbsp;<span class="arg">Current</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Tests can populate this with a callback, and that callback will get called
each round right after the AddRoundKey step gets executed  encrypt().
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">roundNum</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
        <div class="entryOverview">Round number.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">Current</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">null</span>)&gt;</div>
        <div class="entryOverview">state.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_crypt_aes.js.source.html#line280">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>






  <td>
    <a name="goog.crypt.Aes.prototype.testAfterMixColumns_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">testAfterMixColumns_<span class="args">(<span class="arg">roundNum</span>,&nbsp;<span class="arg">Current</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Tests can populate this with a callback, and that callback will get called
each round right after the MixColumns step gets executed *but only in the
decrypt() function*.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">roundNum</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
        <div class="entryOverview">Round number.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">Current</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">null</span>)&gt;</div>
        <div class="entryOverview">state.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_crypt_aes.js.source.html#line270">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>






  <td>
    <a name="goog.crypt.Aes.prototype.testAfterShiftRows_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">testAfterShiftRows_<span class="args">(<span class="arg">roundNum</span>,&nbsp;<span class="arg">Current</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Tests can populate this with a callback, and that callback will get called
each round right after the ShiftRows step gets executed *in both functions
encrypt() and decrypt()*.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">roundNum</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
        <div class="entryOverview">Round number.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">Current</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">null</span>)&gt;</div>
        <div class="entryOverview">state.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_crypt_aes.js.source.html#line259">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>






  <td>
    <a name="goog.crypt.Aes.prototype.testAfterSubBytes_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">testAfterSubBytes_<span class="args">(<span class="arg">roundNum</span>,&nbsp;<span class="arg">Current</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Tests can populate this with a callback, and that callback will get called
each round right after the SubBytes step gets executed *in both functions
encrypt() and decrypt()*.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">roundNum</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
        <div class="entryOverview">Round number.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">Current</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">null</span>)&gt;</div>
        <div class="entryOverview">state.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_crypt_aes.js.source.html#line248">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>






  <td>
    <a name="goog.crypt.Aes.prototype.testKeySchedule_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">testKeySchedule_<span class="args">(<span class="arg">roundNum</span>,&nbsp;<span class="arg">Computed</span>,&nbsp;<span class="arg">index</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Tests can populate this with a callback, and that callback will get called
before each round on the round key.  *Gets called in both the encrypt() and
decrypt() functions.*
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">roundNum</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
        <div class="entryOverview">Round number.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">Computed</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;</div>
        <div class="entryOverview">key schedule.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">index</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
        <div class="entryOverview">The index into the key schedule to test. This is not necessarily roundNum because the key schedule is used in reverse in the case of decryption.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_crypt_aes.js.source.html#line294">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>






  <td>
    <a name="goog.crypt.Aes.prototype.testStartRound_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">testStartRound_<span class="args">(<span class="arg">roundNum</span>,&nbsp;<span class="arg">Current</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Tests can populate this with a callback, and that callback will get called
at the start of each round *in both functions encrypt() and decrypt()*.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">roundNum</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
        <div class="entryOverview">Round number.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">Current</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">null</span>)&gt;</div>
        <div class="entryOverview">state.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_crypt_aes.js.source.html#line237">code &raquo;</a>
  </td>
     </tr>


  </table>
</div>
</div>




<h2>Instance Properties</h2>







<div>
       <div class="desc">
         Defined in
         <span class="fn-name">
            <a href="class_goog_crypt_Aes.html">
              goog.crypt.Aes
            </a>
         </span>
       </div>






<div class="section">
  <table class="horiz-rule">


     <tr class="even entry private">
       <td class="access"></td>





  <a name="goog.crypt.Aes.prototype.keyLength_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">keyLength_</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
     </div>


     <div class="entryOverview">
       Key length, in words.
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_crypt_aes.js.source.html#line61">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>





  <a name="goog.crypt.Aes.prototype.keySchedule_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">keySchedule_</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;</div>
     </div>


     <div class="entryOverview">
       The key schedule.
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_crypt_aes.js.source.html#line559">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>





  <a name="goog.crypt.Aes.prototype.key_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">key_</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;</div>
     </div>


     <div class="entryOverview">
       The AES key.
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_crypt_aes.js.source.html#line54">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>





  <a name="goog.crypt.Aes.prototype.numberOfRounds_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">numberOfRounds_</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
     </div>


     <div class="entryOverview">
       Number of rounds.  Based on key length per AES spec.
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_crypt_aes.js.source.html#line68">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>





  <a name="goog.crypt.Aes.prototype.state_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">state_</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">null</span>)&gt;</div>
     </div>


     <div class="entryOverview">
       4x4 byte array containing the current state.
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_crypt_aes.js.source.html#line75">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>





  <a name="goog.crypt.Aes.prototype.temp_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">temp_</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;<span>&nbsp;|&nbsp;</span><span class="type">null</span>)&gt;</div>
     </div>


     <div class="entryOverview">
       Scratch temporary array for calculation.
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_crypt_aes.js.source.html#line82">Code &raquo;</a>
  </td>
     </tr>


  </table>
</div>
</div>




<h2>Static Methods</h2>






<div class="section">
  <table class="horiz-rule">


     <tr class="even entry private">
       <td class="access"></td>






  <td>
    <a name="goog.crypt.Aes.assertKeyArray_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.crypt.Aes.</span><span class="entryName">assertKeyArray_<span class="args">(<span class="arg">arr</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Asserts that the key's array of integers is in the correct format.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">arr</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;</div>
        <div class="entryOverview">AES key as array of integers.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_crypt_aes.js.source.html#line217">code &raquo;</a>
  </td>
     </tr>


  </table>
</div>



<h2>Static Properties</h2>






<div class="section">
  <table class="horiz-rule">


     <tr class="even entry private">
       <td class="access"></td>





  <a name="goog.crypt.Aes.BLOCK_SIZE_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.crypt.Aes.</span><span class="entryName">BLOCK_SIZE_</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
     </div>


     <div class="entryOverview">
       Block size, in words.  Fixed at 4 per AES spec.
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_crypt_aes.js.source.html#line209">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>





  <a name="goog.crypt.Aes.INV_SBOX_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.crypt.Aes.</span><span class="entryName">INV_SBOX_</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;</div>
     </div>


     <div class="entryOverview">
       Precomputed InvSBox lookup.
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_crypt_aes.js.source.html#line623">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>





  <a name="goog.crypt.Aes.MULT_2_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.crypt.Aes.</span><span class="entryName">MULT_2_</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;</div>
     </div>


     <div class="entryOverview">
       Precomputed lookup of multiplication by 2 in GF(2^8)
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_crypt_aes.js.source.html#line699">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>





  <a name="goog.crypt.Aes.MULT_3_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.crypt.Aes.</span><span class="entryName">MULT_3_</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;</div>
     </div>


     <div class="entryOverview">
       Precomputed lookup of multiplication by 3 in GF(2^8)
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_crypt_aes.js.source.html#line755">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>





  <a name="goog.crypt.Aes.MULT_9_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.crypt.Aes.</span><span class="entryName">MULT_9_</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;</div>
     </div>


     <div class="entryOverview">
       Precomputed lookup of multiplication by 9 in GF(2^8)
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_crypt_aes.js.source.html#line811">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>





  <a name="goog.crypt.Aes.MULT_B_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.crypt.Aes.</span><span class="entryName">MULT_B_</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;</div>
     </div>


     <div class="entryOverview">
       Precomputed lookup of multiplication by 11 in GF(2^8)
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_crypt_aes.js.source.html#line867">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>





  <a name="goog.crypt.Aes.MULT_D_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.crypt.Aes.</span><span class="entryName">MULT_D_</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;</div>
     </div>


     <div class="entryOverview">
       Precomputed lookup of multiplication by 13 in GF(2^8)
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_crypt_aes.js.source.html#line923">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>





  <a name="goog.crypt.Aes.MULT_E_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.crypt.Aes.</span><span class="entryName">MULT_E_</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;</div>
     </div>


     <div class="entryOverview">
       Precomputed lookup of multiplication by 14 in GF(2^8)
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_crypt_aes.js.source.html#line979">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>





  <a name="goog.crypt.Aes.RCON_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.crypt.Aes.</span><span class="entryName">RCON_</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;</div>
     </div>


     <div class="entryOverview">
       Precomputed RCon lookup.
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_crypt_aes.js.source.html#line679">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>





  <a name="goog.crypt.Aes.SBOX_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.crypt.Aes.</span><span class="entryName">SBOX_</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;</div>
     </div>


     <div class="entryOverview">
       Precomputed SBox lookup.
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_crypt_aes.js.source.html#line567">Code &raquo;</a>
  </td>
     </tr>


  </table>
</div>









<div class="section">
  <table class="horiz-rule">


  </table>
</div>
      <!-- Column 1 end -->
    </div>

        <div class="col2">
          <!-- Column 2 start -->
          <div class="col2-c">
            <h2 id="ref-head">Package crypt</h2>
            <div id="localView"></div>
          </div>

          <div class="col2-c">
            <h2 id="ref-head">Package Reference</h2>
            <div id="sideTypeIndex" rootPath="" current="crypt.Aes"></div>
          </div>
          <!-- Column 2 end -->
        </div>
</div>
</div>

</body>
</html>
